<div class="main-title">
  <h2>{if $id}修改{else}添加{/if}标签</h2>
</div>
<div class="main-section">
  <form method="post" action="/admin/tag/save" class="j-form">
    <ul class="form-group form-inline">
      <li>
        <input type="text" class="form-control" name="name" value="{$data.name}" required>
        <label>标签名</label>
      </li>
      <li>
        <input type="number" class="form-control" name="sort" value="{$data.sort}" required>
        <label>排序值</label>
      </li>
      <li>
        <label>
          <input type="checkbox" name="status" value="1" {if $data.status}checked {/if} > 隐藏
        </label>
      </li>
      <li>
        <input type="hidden" name="id" value="{$id}">
        <input type="submit" value="提交表单" class="btn btn-primary">
        <a href="/admin/tag/index" class="btn btn-default">返回列表</a>
      </li>
    </ul>
  </form>
</div>
<script>
  main.menuActive('tag');
  main.ajaxForm('.j-form', function () {
    main.content('/admin/tag/index');
  });
</script>